package collection.Demo09;

import java.util.HashSet;

/**
 * @Author Miku
 * @Create 2021/4/16 15:36
 * HashSet的使用
 */
public class Test3 {
    public static void main(String[] args) {
        HashSet<Person> people = new HashSet<>();
        Person p1 = new Person("miku", 16);
        Person p2 = new Person("luka", 18);
        Person p3 = new Person("test", 20);
        Person p4 = new Person("test", 20);

        people.add(p1);
        people.add(p2);
        people.add(p3);
        people.add(p4);

        System.out.println("元素个数"+people.size());
        System.out.println(people);

    }
}
